/**
 * \file TPType.h
 * \author Ameen Jaber
 * \author Mohamad Noureddine
 * \author Mohamed Sabra
 * \brief Contains definition of TripleP's custom types
 */
#ifndef __TPTYPE_H_
#define __TPTYPE_H_

#include <util.h>

class TPType {
 public:
  int id; //!< The id of the type
  std::string type_name; //!< The name of the defined type 
  TP_Op_t type; //!< The TripleP type of the class
  
  TPType * _t1; //!< The first subtype
  TPType * _t2; //!< The second subtype, can be null in many cases

  /**
   *\brief Default constructor
   */
  TPType();

  /**
   *\brief Constructor
   */
  TPType(int,//!< Input id
	 std::string,//!< Input name
	 TP_Op_t //!< The input type
	 );

  /**
   *\brief Destructor
   */
  ~TPType();

  /**
   *\brief Insert subtype
   * @return returns 1 if successfull and -1 if not x
   */
  int insert_subtype(TPType * //!< Type to insert
		     );

  /**
   *\brief Gets the hash key for this type
   * @return returns a string with the key to the hash table
   */
  std::string get_hashkey();

  /**
   *\brief Assign the type's name
   */
  void assign_name(std::string //!< The type's name
		   );

  /**
   *\brief Get the type name
   */
  std::string get_name();

  /**
   *\brief Get the type id 
   */
  int get_id();
};

#endif
